package name.vaccari.matteo.tai.phonedirectory.network;

import static org.junit.Assert.assertEquals;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;

import org.junit.Test;


public class ProtocolTest {

	@Test
	public void testEchoProtocol() throws Exception {
		EchoProtocol protocol = new EchoProtocol();
		InputStream inputStream = new ByteArrayInputStream("uno\ndue\n".getBytes());
		ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
		
		protocol.process(inputStream , outputStream);
		
		assertEquals("uno\ndue\n", outputStream.toString());
	}
}
